package com.czw.ali.register

import android.app.Application
import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory
import com.didi.drouter.annotation.Service
import com.mtzqc.common.init.InitService
import com.mtzqc.common.task.ITask
import com.mtzqc.helper.PrivacyHelper


@Service(
    function = [InitService::class],
    priority = 50
)
class PushInitRegister(
) : InitService {
    override val dependsLib: Array<Class<out ITask>>?
        get() = null
    override val depends: Array<String>?
        get() = null
    override val depName: String
        get() = "Push"
    override val priority: Int
        get() = 50

    override fun executeInit(app: Application, debug: Boolean, dev: Boolean): Boolean {
        PushServiceFactory.init(app)
        if (PrivacyHelper.isAgree(app)) {
            PushAgreeRegister().executeInit(app, debug, dev)
        }
        return true
    }
}